From eae2983e7932d2ea802feed87c0ccf6be27d85d7 Mon Sep 17 00:00:00 2001
From: Icenowy Zheng <icenowy@aosc.io>
Date: Sat, 23 Dec 2017 10:44:55 +0800
Subject: [PATCH 17/35] mfd: axp20x: add support for AXP805 PMIC

AXP805 is a PMIC from X-Powers, which is used in the Allwinner H6
reference design. It's just a AXP806 with different customization data,
but it's customized to work defaultly under I2C rather than RSB.

Add support for it by just re-using AXP806_ID to add a I2C-based AXP
PMIC.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
 Documentation/devicetree/bindings/mfd/axp20x.txt | 6 ++++--
 drivers/mfd/axp20x-i2c.c                         | 2 ++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/mfd/axp20x.txt b/Documentation/devicetree/bindings/mfd/axp20x.txt
index 9455503..10ce35f 100644
--- a/Documentation/devicetree/bindings/mfd/axp20x.txt
+++ b/Documentation/devicetree/bindings/mfd/axp20x.txt
@@ -7,6 +7,7 @@ axp209 (X-Powers)
 axp221 (X-Powers)
 axp223 (X-Powers)
 axp803 (X-Powers)
+axp805 (X-Powers)
 axp806 (X-Powers)
 axp809 (X-Powers)
 axp813 (X-Powers)
@@ -24,6 +25,7 @@ Required properties:
     * "x-powers,axp221"
     * "x-powers,axp223"
     * "x-powers,axp803"
+    * "x-powers,axp805"
     * "x-powers,axp806"
     * "x-powers,axp809"
     * "x-powers,axp813"
@@ -45,7 +47,7 @@ Optional properties:
 			  board is driving OTG VBus or not.
 			  (axp221 / axp223 / axp813 only)
 
-- x-powers,master-mode: Boolean (axp806 only). Set this when the PMIC is
+- x-powers,master-mode: Boolean (axp805/806 only). Set this when the PMIC is
 			wired for master mode. The default is slave mode.
 
 - <input>-supply: a phandle to the regulator supply node. May be omitted if
@@ -133,7 +135,7 @@ LDO_IO0		: LDO		: ips-supply		: GPIO 0
 LDO_IO1		: LDO		: ips-supply		: GPIO 1
 RTC_LDO		: LDO		: ips-supply		: always on
 
-AXP806 regulators, type, and corresponding input supply names:
+AXP805/806 regulators, type, and corresponding input supply names:
 
 Regulator	  Type		  Supply Name		  Notes
 ---------	  ----		  -----------		  -----
diff --git a/drivers/mfd/axp20x-i2c.c b/drivers/mfd/axp20x-i2c.c
index d35a5fe..27ba2c3 100644
--- a/drivers/mfd/axp20x-i2c.c
+++ b/drivers/mfd/axp20x-i2c.c
@@ -65,6 +65,7 @@ static const struct of_device_id axp20x_i2c_of_match[] = {
 	{ .compatible = "x-powers,axp202", .data = (void *)AXP202_ID },
 	{ .compatible = "x-powers,axp209", .data = (void *)AXP209_ID },
 	{ .compatible = "x-powers,axp221", .data = (void *)AXP221_ID },
+	{ .compatible = "x-powers,axp805", .data = (void *)AXP806_ID },
 	{ },
 };
 MODULE_DEVICE_TABLE(of, axp20x_i2c_of_match);
@@ -74,6 +75,7 @@ static const struct i2c_device_id axp20x_i2c_id[] = {
 	{ "axp202", 0 },
 	{ "axp209", 0 },
 	{ "axp221", 0 },
+	{ "axp805", 0 },
 	{ },
 };
 MODULE_DEVICE_TABLE(i2c, axp20x_i2c_id);
-- 
2.7.4

